<html>
<script>
function ors()
{
 if (event.srcElement.readyState == 'complete')
 {
  var sView = getQS('view');
  if (sView != null) 
   SetView(sView);
  document.all.ifr.style.visibility = 'visible';
 }
 else
 {
  document.all.ifr.style.visibility = 'hidden';
 }
}
function SetView(sView)
{
 var ifDoc = document.frames['ifr'].document.all;
 var oSel = ifDoc['SavedQuerySelector'];
 if (oSel != null)
 {
  var v = GetSelectValue(oSel, sView);
  if (v)
  {
   oSel.DefaultValue = v;
   oSel.DataValue = v;
   oSel.FireOnChange();
  }
 }
}
function GetSelectValue(oSel, sText)
{
 for (var i=0;i<oSel.options.length;i++)
  if (oSel.options[i].text == sText)
   return oSel.options[i].value; 
}
function getQS(name)
{
 var ret = '';
 if (window.location.search != null && window.location.search.length > 1)
 {
  var aQS = window.location.search.substring(1).split('&');
  if (aQS != null)
   for (var i=0;i<aQS.length;i++)
    if (aQS[i].indexOf(name + '=') == 0)
     ret = aQS[i].substring(name.length + 1).replace('%20', ' ');
 }
 return ret;
}
function Init()
{
 var etc = getQS('etc');
 if (etc != null)
  document.all.ifr.src = '/_root/homepage.aspx?etc=' + etc;
}
</script>
<body style="margin:0" onload="Init();">
<iframe onreadystatechange="ors();" id="ifr" src="about:blank" width="100%" height="100%" frameborder="0" leftmargin="0">
</body></html>

